using UnityEngine;
[RequireComponent(typeof(LineRenderer))]
public class ForeignMoney : MonoBehaviour
{
    private LineRenderer line;
    public Transform A;
    public Transform B;
    private void OnEnable()
    {
        line = GetComponent<LineRenderer>();
        var count = A.childCount;
        line.positionCount = count;
        for(var i = 0; i < count; i++)
        {
            var y1 = A.GetChild(i).lossyScale.y;
            var y2 = B.GetChild(i).lossyScale.y;
            line.SetPosition(i, new Vector3(i * 10, (y2 - y1) * 2, 0));
        }
        
    }
}
